#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 3e4+10;
int a[maxn];
int main()
{
	int n,t,i;
	cin>>n>>t;
	for(int i = 1;i<=n-1;i++)
	{
		cin>>a[i];
	}
	for(i = 1;i<=n-1;)
	{
		if(i==t)
		{
			printf("YES\n");
			return 0;
		}
		i = i+a[i];
	}
	if(i==t) printf("YES\n");
	else printf("NO\n");
	return 0;
}
